package com.chapter.sample.service.impl;

import com.chapter.sample.dao.UserDao;
import com.chapter.sample.mapper.UserMapper;
import com.chapter.sample.pojo.User;
import com.chapter.sample.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

@Component
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Autowired
    UserMapper userMapper;

    public UserServiceImpl() {
        System.out.println("UserServiceImpl创建");
    }

    @Override
    public void show() {
        List<User> list = userMapper.findAll();
        list.forEach(v ->{
            System.out.println(v);
        });

    }
}
